<template>
  <goods-list v-if="currPage == 'list'" @toDetails="onToDetails"></goods-list>
  <goods-details
    v-if="currPage == 'details'"
    :record="record"
    @back="currPage = 'list'"
  ></goods-details>
</template>

<script setup>
import GoodsList from "./GoodsList.vue";
import GoodsDetails from "./GoodsDetails.vue";
import { ref } from "vue";


const currPage = ref("list");
const record = ref({});
const onToDetails = (rec) => {
  record.value = rec;
  currPage.value = "details";
};
</script>

<style scoped>
</style>
